#ifndef CC_WINDOW_H
#define CC_WINDOW_H

#include <QMainWindow>
#include <QtWidgets>

#include "ccGLWidget.h"
#include "ccPickingListener.h"
#include "ccPickingHub.h"
#include "ccPointCloud.h"
#include "ccClipBox.h"
#include "ccPolyline.h"
#include "ccHObject.h"
#include <pcl_conversions/pcl_conversions.h>
#include <pcl/point_cloud.h>
#include <pcl/point_types.h>



static ccGLWindow *s_pickingWindow = nullptr;



class CCWindow : public QMainWindow
{
    Q_OBJECT
public:
    explicit CCWindow(QWidget *parent = nullptr);
    ~CCWindow();
    void addToDB(ccHObject *entity, ccGLWindow *detWin);
    void setPointCloud(const pcl::PointCloud<pcl::PointXYZ>::Ptr pt);
    void clearPointCloud();



private:
    QMdiArea* m_mdiArea_;
    ccClipBox* m_clipBox_ = nullptr;
    std::vector<std::vector<ccHObject *>> m_muti_group_vec_;

    ccGLWindow *new3DView(bool allowEntitySelection);
    ccGLWindow *getActiveGLWindow();
    void activeClipBox();
    void removeFromDB(ccHObject *entity, ccGLWindow *detWin);
    
    void getColorRamp(float minz, float maxz, float pz, float &r, float &g, float &b);
    
};

#endif // CC_WINDOW_H
